EMT Practice Test

1. Question Content...


Question List

Question1: Given:
Map<ID, Account> accountMap = new Map>ID, Account> ([SELECT Id, Name FROM Account]); What are three valid Apex loop structures for iterating through items in the collection? (Choose three.)

Question2: A developer executes the following query in Apex to retrieve a list of contacts for each account:
List<account> accounts = [Select ID, Name, (Select ID, Name from Contacts) from Account] ; Which two exceptions may occur when it executes? (Choose two.)

Question3: How can a developer warn users of SOQL governor limit violations in a trigger?

Question4: Which two platform features allow for the use of unsupported languages? Choose 2 answers

Question5: A candidate may apply to multiple jobs at the company Universal Containers by submtting a single application per job posting. Once an application is submitted for a job posting, that application cannot be modified to be resubmitted to a different job posting.What can the administrator do to associate an application with each job posting in the schema for the organization?

Question6: To which data type in Apex a currency field automatically assigned?

Question7: A developer runs the following anonymous code block:List<Account> acc = [SELECT Id FROM Account LIMIT 10];Delete acc;Database.emptyRecycleBin(acc);system.debug(Limits.getDMLStatements()+ ', '
+Limits.getLimitDMLStatements());What is the result?

Question8: What is true for a partial sandbox that is not true for a full sandbox? Choose 2 answers:

Question9: An Account trigger updates all related Contacts and Cases each time an Account is saved using the following two DML statements:
update allContacts; update allCases;
What is the result if the Case update exceeds the governor limit for maximum number of DML records?

Question10: To which primitive data type in Apex is a currency field atomically assigned?

Question11: A developer wants to use all of the functionality provided by the standard controller for an object, but needs to override the Save standard action in a controller extension. Which two are required in the controller extension class?

Question12: Which two sosl searches will return records matching search criteria contained in any of the searchable text fields on an object? choose 2 answers

Question13: While writing a test class that covers an OpportunityLineItem trigger, a Developer is unable to create a standard PriceBook since one already exists in the org.
How should the Developer overcome this problem?

Question14: What is a capability of the <ltng:require> tag that is used for loading external Javascript libraries in Lightning Component? (Choose three.)

Question15: In Lightning component framework, which resource can be used to fire events? Choose 2 answers.

Question16: What declarative method helps ensure quality data? Choose 3 answers

Question17: In the code below, what type does Boolean inherit from?
Boolean b= true;

Question18: When an Account's custom picklist field called Customer Sentiment is changed to a value of "Confused", a new related Case should automatically be created.
Which two methods should a developer use to create this case? (Choose two.)

Question19: Where can a developer identify the time taken by each process in a transaction using Developer Console log inspector?

Question20: When would a developer use a custom controller instead of a controller extension? Choose 2 answers:

Question21: Which two Apex data types can be used to reference a Salesforce record ID dynamically? (Choose two.)

Question22: What is the proper process for an Apex Unit Test

Question23: What is a capability of the Developer Console?

Question24: Which type of controller should a developer use to include a list of related records for a Custom Object record on a Visualforce page without needing additional test coverage?

Question25: What is a benefit of the Lightning Component framework?Choose 3 answers

Question26: Where can debug log filter settings be set?Choose 2 answers

Question27: A developer declared a class as follow.
public class wysiwyg { // Properties and methods including DML }
Which invocation of a class method will obey the organization-wide defaults and sharing settings for the running user in the Salesforce Organization?

Question28: In which two trigger types can a developer modify the new sObject records that are obtained by the trigger.new context? Choose 2 answers

Question29: When viewing a Quote, the sales representative wants to easily see how many discounted items are included in the Quote Line Items.
What should a developer do to meet this requirement?

Question30: Which approach should be used to provide test data for a test class?

Question31: Which two number expression evaluate correctly? Choose 2 answers

Question32: Which standard field needs to be populated when a developer inserts new Contact records programmatically?

Question33: The sales management team requires that the lead source field of the Lead record be populated when Lead is converted. What would a developer use to ensure that a user populates the Lead source field?

Question34: Which type of code represents the view in the MVC architecture on the Force.com platform?

Question35: When is an Apex Trigger required instead of a Process Builder Process?

Question36: What are two valid options for iterating through each Account in the collection List<Account> named AccountList? (Choose two.)

Question37: Which two ways can a developer instantiate a PageReference in Apex? Choose 2 answers

Question38: Which two combined methods should a developer use to prevent more than one open Opportunity on each Account? Choose 2 answers

Question39: A developer created a visualforce page using a custom controller that calls an apex helper class. A method in the helper class hits a governor limit. what is the result of the transaction?

Question40: What is the result when a Visualforce page calls an Apex controller, which calls another Apex class, which then results in hitting a governor limit?

Question41: A developer creates a new Visualforce page and Apex extension, and writes test classes that exercise 95% coverage of the new Apex extension.Change set deployment to production fails with the test coverage warning: "Average test coverage across all Apex classes and triggers is 74%, at least 75% test coverage is required."What can the developer do to successfully deploy the new Visualforce page and extension?

Question42: In which order does SalesForce execute events upon saving a record?

Question43: Which user can edit a record after it has been locked for approval? (Choose 2)

Question44: Which SOQL query successfully returns the Accounts grouped by name?

Question45: What is a valid statement about Apex classes and interfaces? Choose 2 answers:

Question46: What is the minimum log level needed to see user-generated debug statements?

Question47: Which data structure is returned to a developer when performing a SOSL search?

Question48: Which collection type provides unique key/value pairings of data?

Question49: A developer needs to provide a way to mass edit,update, and delete records from a list view in which two ways can this be accomlpished? choose 2 answers

Question50: A developer writes the following code:

What is the result of the debug statement?

Question51: A developer needs to find information about @future methods that were invoked. From which system monitoring feature can the developer see this information?

Question52: In which two org types can a developer create new Apex Classes? Choose 2 answers

Question53: A developer wrote a unit test to confirm that a custom exception works properly in a custom controller, but the test failed due to an exception being thrown. What step should the developer take to resolve the issue and properly test the exception?

Question54: An sObject named Application_c has a lookup relationship to another sObject named Position_c. Both Application _c and Position_c have a picklist field named Status_c.When the Status_c field on Position_c is updated, the Status_c field on Application_c needs to be populated automatically with the same value, and execute a workflow rule on Application_c.How can a developer accomplish this?

Question55: What is a benefit of using an after insert trigger over using a before insert trigger?

Question56: A developer is asked to write negative tests as part of the unit testing for a method that calculates a person's age based on birth date. What should the negative tests include?

Question57: A reviewer is required to enter a reason in the comments field only when a candidate is recommended to be hired. Which action can a developer take to enforce this requirement?

Question58: Which three data types can be returned from an SOQL statement?

Question59: What is the preferred way to reference web content such as images, style sheets, JavaScript, and other libraries that is used in Visualforce pages?

Question60: Managed Packages can be created in which type of org?

Question61: How can a developer use a Set<Id> to limit the number of records returned by a SOQL query?

Question62: A developer has the following query: Contact c = [SELECT id, firstname, lastname, email FROM Contact WHERE lastname = 'Smith']; What does the query return if there is no Contact with the last name 'Smith'?

Question63: Which statement should a developer avoid using inside procedural loops? (Choose 2)

Question64: Given the code below, which three statements can be used to create the controller variable? Public class accountlistcontroller{ public list<account>getaccounts(){ return controller.getrecords(); } } Choose 3 answers

Question65: Which two strategies should a developer use to avoid hitting governor limits when developing in a multi-tenant environment? (Choose two.)

Question66: What is an important consideration when developing in a multi-tenant environment?

Question67: A developer needs to create records for the object Property__c. The developer creates the following code block:List propertiesToCreate = helperClass.createProperties();try { // line 3 } catch (Exception exp ) {
//exception
handling }Which line of code would the developer insert at line 3 to ensure that at least some records are created, even if a few records have errors and fail to be created?

Question68: What is a capability of the Force.com IDE? Choose 2 answers

Question69: Which code block returns the ListView of an Account object using the following debug statement?
system.debug(controller.getListViewOptions() );

Question70: What are three ways for a developer to execute tests in an org? Choose 3.

Question71: What is the accurate statement about with sharing keyword? choose 2 answers

Question72: For which three items can a trace flag be configured? (Choose three.)

Question73: How can a developer retrieve all Opportunity record type labels to populate a list collection?Choose 2 answers

Question74: What is a capability of a StandardSetController?Choose 2 answers

Question75: In the Lightning Component framework, where is client-side controller logic contained?

Question76: A developer needs to confirm that an Account trigger is working correctly without changing the organization's data.What would the developer do to test the Account trigger?

Question77: A visualforce page uses the contact standard controller. How can a developer display the name from the parent account record on the page?

Question78: A developer wants to handle the click event for a lightning:button component. The on click attribute for the component references a JavaScript function in which resource in the component bundle?

Question79: Which scenario is invalid for execution by unit tests?

Question80: A developer needs to create a baseline set of data (Accounts, Contacts, Products, Assets) for an entire suite of tests allowing them to test independent requirements various types of Salesforce Cases. Which approach can efficiently generate the required data for each unit test?

Question81: What is accurate statement about with sharing keyword? Choose 2 answers

Question82: A developer working on a time management application wants to make total hours for each timecard available to applications users. A timecard entry has a Master-Detail relationship to a timecard. Which approach should the developer use to accomplish this declaratively?

Question83: A company that uses a Custom object to track candidates would like to send candidate information automatically to a third -party human resource system when a candidate is hired. What can a developer do to accomplish this task?

Question84: Which two number expressions evaluate correctly? (Choose two.)

Question85: Which type of code represents the Model in the MVC architecture on the Force.com platform?

Question86: A developer executes the following code in the Developer Console:
List<Account> fList = new List <Account> ();For(integer i= 1; I <= 200; i++){fList.add(new Account ( Name
= 'Universal Account ' + i));}Insert fList;List <Account> sList = new List<Account>();For (integer I = 201; I
<=
20000; i ++){sList.add(new Account (Name = 'Universal Account ' + i));}Insert sList;How many accounts are created in the Salesforce organization ?

Question87: Which resource can be included in a Lightning Component bundle? Choose 2 answers

Question88: Which two statements are true about using the @testSetup annotation in an Apex test class? (Choose two.)

Question89: What can used to delete components from production?

Question90: A developer creates a Workflow Rule declaratively that updates a field on an object. An Apex update trigger exists for that object. What happens when a user updates a record?

Question91: A developer needs to create a custom Visualforce button for the Opportunity object page layout that will cause a web service to be called and redirect the user to a new page when clicked. Which three attributes need to be defined in the <apex:page> tag of the Visualforce page to enable this functionality? Choose three answers.

Question92: A company wants to create an employee rating program that allows employees to rate each other. An employee's average rating must be displayed on the employee record. Employees must be able to create rating records, but are not allowed to create employee records. Which two actions should a developer take to accomplish this task? choose 2 answers

Question93: A developer created a helper class with a method that can be called from Visualforce pages, web services, triggers, and of even anonymous code. When the method is called from a trigger, the developer needs to execute logic that should not be executed If the method Is called from anywhere else. How can the developer determine if the code Is executed in a trigger context?

Question94: What is a capability of cross-object formula fields? Choose 3 answers

Question95: Which component is available to deploy using Metadata API? Choose 2 answers

Question96: How can a custom type be identified as unique when added to a Set?

Question97: How can a developer refer to, or instantiate a PageReference in Apex? Choose 2 answers

Question98: A developer wants to override a button using Visualforce on an object.
What is the requirement?

Question99: A developer wants multiple test classes to use the same set of test data. How should the developer create the test data?

Question100: A developer is creating an enhancement to an application that will allow people to be related to their employer.
Which date model should be used to track the data?

Question101: Given the code below, what can be done so that recordcount can be accessed by a test class, but not by a non-test class? Public class mycontroller{ private integer recordcount; }

Question102: A developer wants to display all of the available record types for a Case object. The developer also wants to display the picklist values for the Case.Status field. The Case object and the Case.Status field are on a custom Visualforce page. Which action can the developer perform to get the record types and picklist values in the controller? (Choose 2)

Question103: A developer needs to import customer subscription records into salesforce and attach them to existing account records. Which 2 actions should the developer take to ensure the subscription records are related to the correct account records? Choose 2 answers

Question104: In the code below, which type does String inherit from? String s = 'Hello World';

Question105: A developer needs to display all of the available fields for an object.
In which two ways can the developer retrieve the available fields if the variable myObject represents the name of the object? (Choose two.)

Question106: A company would like to send an offer letter to a candidate, have the candidate sign it electronically, and then send the letter back.What can a developer do to accomplish this?

Question107: A developer working on a time management application wants to make total hours for each timecard available to application users. A timecard entry has a Master-Detail relationship to a timecard.
Which approach should the developer use to accomplish this declaratively?

Question108: Which set of roll-up types are available when creating a roll-up summary field?

Question109: Which two queries can a developer use in a visualforce controller to protect against SOQL injection Vulnerabilities? Choose 2 answers

Question110: Candidates are reviewed by four separate reviewers and their comments and scores which range from 1 (lowest) to 5 (highest) are stored on a review record that is a detail record for a candidate what is the best way to indicate that a combined review score of 15 of better is required to recommend that the candidate come in for an interview?

Question111: Which code segment can be used to control when the dowork() method is called?

Question112: Which statement is true about developing in a multi-tenant environment?

Question113: A developer is asked to create a PDF quote document formatted using the company's branding guidelines, and automatically save it to the Opportunity record.
Which two ways should a developer create this functionality? (Choose two.)

Question114: What is a correct pattern to follow when programming in Apex on a Multi-tenant platform?

Question115: What is an accurate constructor for a custom controller named "MyController"?

Question116: A user selects a value from a multi-select picklist. How is this selected value represented in Apex?

Question117: In a single record, a user selects multiple values from a multi-select picklist.
How are the selected values represented in Apex?

Question118: How should a developer make sure that a child record on a custom object, with a lookup to the Account object, has the same sharing access as its associated account?

Question119: A developer has javascript code that needs to be called by controller functions in multiple components by extending a new abstract component. Which resource in the abstract component bundle allows the developer to achieve this

Question120: A developer writes a SOQL query to find child records for a specific parent. How many levels can be returned in a single query?

Question121: Which two queries can a developer use in a Visualforce controller to protect against SOQL injection vulnerabilities? Choose 2 answers

Question122: What is the data type returned by the following SOSL search? {FIND 'Acme*' in name fields returning account,opportunity};

Question123: A Visualforce page is required for displaying and editing Case records that includes both standard and custom functionality defined in an Apex class called myControllerExtension.
The Visualforce page should include which <apex:page> attribute(s) to correctly implement controller functionality?

Question124: What is the advantage of Salesforce Lightning?

Question125: A platform developer needs to write an apex method that will only perform an action if a record is assigned to a specific record type. Which two options allow the developer to dynamically determine the ID of the required record type by its name? Choose 2 answers

Question126: Which statement would a developer use when creating test data for products and pricebooks?

Question127: What is an accurate statement about variable scope? (Choose 3)